package com.qf.springcloud.callback;

import com.qf.springcloud.pojo.User;
import com.qf.springcloud.service.UserService;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @Auther: xiaobobo
 * @Date: 2019/3/8 10:33
 * @Description:
 */
@Component
public class UserServiceFallBack implements FallbackFactory<UserService> {
    @Override
    public UserService create(Throwable throwable) {
        return new UserService(){
            @Override
            public Object getUserInfo() {
                return "这里是服务的降级返回来的数据";
            }
        };
    }
}
